Transaction History

Obtain Transaction History

get_transaction_history(self, account_id, **params)


In [1]:
from datetime import datetime, timedelta
import pandas as pd
import oandapy
import configparser

config = configparser.ConfigParser()
config.read('../config/config_v1.ini')
account_id = config['oanda']['account_id']
api_key = config['oanda']['api_key']

oanda = oandapy.API(environment="practice", 
                    access_token=api_key)

In [2]:
response = oanda.get_transaction_history(account_id)
print(response)


{'transactions': [{'instrument': 'USD_JPY', 'interest': 0, 'time': '2017-01-27T13:55:07.000000Z', 'side': 'sell', 'price': 115.19, 'accountId': 7173488, 'accountBalance': 99987.8214, 'type': 'TRADE_CLOSE', 'tradeId': 10618882484, 'id': 10618882724, 'units': 1000, 'pl': -0.1736}, {'instrument': 'USD_JPY', 'interest': 0, 'time': '2017-01-27T13:55:06.000000Z', 'tradeOpened': {'units': 1000, 'id': 10618882484}, 'side': 'buy', 'price': 115.204, 'accountId': 7173488, 'accountBalance': 99987.995, 'type': 'MARKET_ORDER_CREATE', 'id': 10618882484, 'units': 1000, 'pl': 0}, {'instrument': 'NZD_USD', 'interest': 0, 'time': '2017-01-27T13:55:06.000000Z', 'tradeOpened': {'units': 1000, 'id': 10618882479}, 'side': 'buy', 'price': 0.72637, 'accountId': 7173488, 'accountBalance': 99987.995, 'type': 'MARKET_ORDER_CREATE', 'id': 10618882479, 'units': 1000, 'pl': 0}, {'instrument': 'AUD_USD', 'interest': 0, 'time': '2017-01-27T13:55:06.000000Z', 'tradeOpened': {'units': 1000, 'id': 10618882472}, 'side': 'buy', 'price': 0.75516, 'accountId': 7173488, 'accountBalance': 99987.995, 'type': 'MARKET_ORDER_CREATE', 'id': 10618882472, 'units': 1000, 'pl': 0}, {'instrument': 'GBP_USD', 'interest': 0, 'time': '2017-01-27T13:54:40.000000Z', 'side': 'sell', 'price': 1.2542, 'accountId': 7173488, 'accountBalance': 99987.995, 'type': 'TRADE_CLOSE', 'tradeId': 10618881939, 'id': 10618881962, 'units': 1000, 'pl': -0.2572}, {'accountId': 7173488, 'instrument': 'GBP_USD', 'stopLossPrice': 1.15, 'id': 10618881951, 'time': '2017-01-27T13:54:40.000000Z', 'type': 'TRADE_UPDATE', 'units': 1000, 'tradeId': 10618881939}, {'instrument': 'GBP_USD', 'interest': 0, 'time': '2017-01-27T13:54:39.000000Z', 'tradeOpened': {'units': 1000, 'id': 10618881939}, 'side': 'buy', 'price': 1.25438, 'accountId': 7173488, 'accountBalance': 99988.2522, 'type': 'MARKET_ORDER_CREATE', 'id': 10618881939, 'units': 1000, 'pl': 0}, {'instrument': 'USD_CHF', 'interest': 0, 'time': '2017-01-27T13:54:39.000000Z', 'tradeOpened': {'units': 1000, 'id': 10618881930}, 'side': 'buy', 'price': 0.99977, 'accountId': 7173488, 'accountBalance': 99988.2522, 'type': 'MARKET_ORDER_CREATE', 'id': 10618881930, 'units': 1000, 'pl': 0}, {'instrument': 'EUR_USD', 'interest': 0, 'time': '2017-01-27T13:54:38.000000Z', 'tradeOpened': {'units': 1000, 'id': 10618881925}, 'side': 'buy', 'price': 1.06951, 'accountId': 7173488, 'accountBalance': 99988.2522, 'type': 'MARKET_ORDER_CREATE', 'id': 10618881925, 'units': 1000, 'pl': 0}, {'accountId': 7173488, 'reason': 'CLIENT_REQUEST', 'orderId': 10618881403, 'id': 10618881452, 'time': '2017-01-27T13:54:20.000000Z', 'type': 'ORDER_CANCEL'}, {'accountId': 7173488, 'instrument': 'AUD_USD', 'reason': 'REPLACES_ORDER', 'orderId': 10618881403, 'id': 10618881427, 'time': '2017-01-27T13:54:20.000000Z', 'expiry': '2017-01-28T21:54:17.000000Z', 'type': 'ORDER_UPDATE', 'units': 1000, 'price': 0.704}, {'accountId': 7173488, 'instrument': 'AUD_USD', 'side': 'buy', 'reason': 'CLIENT_REQUEST', 'id': 10618881403, 'time': '2017-01-27T13:54:18.000000Z', 'expiry': '2017-01-28T21:54:17.000000Z', 'type': 'LIMIT_ORDER_CREATE', 'units': 1000, 'price': 0.742}, {'accountId': 7173488, 'instrument': 'USD_CHF', 'interest': 0.0588, 'id': 10618045173, 'time': '2017-01-26T21:00:00.000000Z', 'accountBalance': 99988.2522, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'NZD_USD', 'interest': 0.061, 'id': 10618045172, 'time': '2017-01-26T21:00:00.000000Z', 'accountBalance': 99988.1934, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'GBP_USD', 'interest': -0.0281, 'id': 10618045171, 'time': '2017-01-26T21:00:00.000000Z', 'accountBalance': 99988.1324, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'EUR_USD', 'interest': -0.1619, 'id': 10618045170, 'time': '2017-01-26T21:00:00.000000Z', 'accountBalance': 99988.1605, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'AUD_USD', 'interest': 0.0724, 'id': 10618045169, 'time': '2017-01-26T21:00:00.000000Z', 'accountBalance': 99988.3224, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'USD_CHF', 'interest': 0.0582, 'id': 10616745950, 'time': '2017-01-25T21:00:00.000000Z', 'accountBalance': 99988.25, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'NZD_USD', 'interest': 0.0611, 'id': 10616745949, 'time': '2017-01-25T21:00:00.000000Z', 'accountBalance': 99988.1918, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'GBP_USD', 'interest': -0.0278, 'id': 10616745948, 'time': '2017-01-25T21:00:00.000000Z', 'accountBalance': 99988.1307, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'EUR_USD', 'interest': -0.1606, 'id': 10616745947, 'time': '2017-01-25T21:00:00.000000Z', 'accountBalance': 99988.1585, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'AUD_USD', 'interest': 0.073, 'id': 10616745946, 'time': '2017-01-25T21:00:00.000000Z', 'accountBalance': 99988.3191, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'USD_CHF', 'interest': 0.0582, 'id': 10615478582, 'time': '2017-01-24T21:00:00.000000Z', 'accountBalance': 99988.2461, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'NZD_USD', 'interest': 0.0609, 'id': 10615478581, 'time': '2017-01-24T21:00:00.000000Z', 'accountBalance': 99988.1879, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'GBP_USD', 'interest': -0.028, 'id': 10615478580, 'time': '2017-01-24T21:00:00.000000Z', 'accountBalance': 99988.127, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'EUR_USD', 'interest': -0.1616, 'id': 10615478579, 'time': '2017-01-24T21:00:00.000000Z', 'accountBalance': 99988.155, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'AUD_USD', 'interest': 0.0738, 'id': 10615478578, 'time': '2017-01-24T21:00:00.000000Z', 'accountBalance': 99988.3166, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'USD_CHF', 'interest': 0.0582, 'id': 10614205734, 'time': '2017-01-23T21:00:00.000000Z', 'accountBalance': 99988.2428, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'NZD_USD', 'interest': 0.0603, 'id': 10614205733, 'time': '2017-01-23T21:00:00.000000Z', 'accountBalance': 99988.1846, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'GBP_USD', 'interest': -0.028, 'id': 10614205732, 'time': '2017-01-23T21:00:00.000000Z', 'accountBalance': 99988.1243, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'EUR_USD', 'interest': -0.1612, 'id': 10614205731, 'time': '2017-01-23T21:00:00.000000Z', 'accountBalance': 99988.1523, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'AUD_USD', 'interest': 0.0731, 'id': 10614205730, 'time': '2017-01-23T21:00:00.000000Z', 'accountBalance': 99988.3135, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'USD_CHF', 'interest': 0.0588, 'id': 10612893759, 'time': '2017-01-22T21:00:00.000000Z', 'accountBalance': 99988.2404, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'NZD_USD', 'interest': 0.0592, 'id': 10612893758, 'time': '2017-01-22T21:00:00.000000Z', 'accountBalance': 99988.1816, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'GBP_USD', 'interest': -0.0282, 'id': 10612893757, 'time': '2017-01-22T21:00:00.000000Z', 'accountBalance': 99988.1224, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'EUR_USD', 'interest': -0.1622, 'id': 10612893756, 'time': '2017-01-22T21:00:00.000000Z', 'accountBalance': 99988.1506, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'AUD_USD', 'interest': 0.073, 'id': 10612893755, 'time': '2017-01-22T21:00:00.000000Z', 'accountBalance': 99988.3128, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'USD_CHF', 'interest': 0.0588, 'id': 10612516793, 'time': '2017-01-21T21:00:00.000000Z', 'accountBalance': 99988.2398, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'NZD_USD', 'interest': 0.0592, 'id': 10612516792, 'time': '2017-01-21T21:00:00.000000Z', 'accountBalance': 99988.181, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'GBP_USD', 'interest': -0.0282, 'id': 10612516791, 'time': '2017-01-21T21:00:00.000000Z', 'accountBalance': 99988.1218, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'EUR_USD', 'interest': -0.1622, 'id': 10612516790, 'time': '2017-01-21T21:00:00.000000Z', 'accountBalance': 99988.15, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'AUD_USD', 'interest': 0.073, 'id': 10612516789, 'time': '2017-01-21T21:00:00.000000Z', 'accountBalance': 99988.3122, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'USD_CHF', 'interest': 0.0565, 'id': 10612124336, 'time': '2017-01-20T21:00:00.000000Z', 'accountBalance': 99988.2392, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'NZD_USD', 'interest': 0.0567, 'id': 10612124335, 'time': '2017-01-20T21:00:00.000000Z', 'accountBalance': 99988.1827, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'GBP_USD', 'interest': -0.0281, 'id': 10612124334, 'time': '2017-01-20T21:00:00.000000Z', 'accountBalance': 99988.126, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'EUR_USD', 'interest': -0.1556, 'id': 10612124333, 'time': '2017-01-20T21:00:00.000000Z', 'accountBalance': 99988.1541, 'type': 'DAILY_INTEREST'}, {'accountId': 7173488, 'instrument': 'AUD_USD', 'interest': 0.0707, 'id': 10612124332, 'time': '2017-01-20T21:00:00.000000Z', 'accountBalance': 99988.3097, 'type': 'DAILY_INTEREST'}, {'instrument': 'USD_JPY', 'interest': 0, 'time': '2017-01-20T02:34:19.000000Z', 'side': 'sell', 'price': 114.739, 'accountId': 7173488, 'accountBalance': 99988.239, 'type': 'TRADE_CLOSE', 'tradeId': 10611191619, 'id': 10611191636, 'units': 1000, 'pl': -0.1739}, {'instrument': 'USD_JPY', 'interest': 0, 'time': '2017-01-20T02:34:17.000000Z', 'tradeOpened': {'units': 1000, 'id': 10611191619}, 'side': 'buy', 'price': 114.753, 'accountId': 7173488, 'accountBalance': 99988.4129, 'type': 'MARKET_ORDER_CREATE', 'id': 10611191619, 'units': 1000, 'pl': 0}, {'instrument': 'NZD_USD', 'interest': 0, 'time': '2017-01-20T02:34:16.000000Z', 'tradeOpened': {'units': 1000, 'id': 10611191617}, 'side': 'buy', 'price': 0.72067, 'accountId': 7173488, 'accountBalance': 99988.4129, 'type': 'MARKET_ORDER_CREATE', 'id': 10611191617, 'units': 1000, 'pl': 0}]}

In [3]:
pd.DataFrame(response['transactions'])


Out[3]:
accountBalance accountId expiry id instrument interest orderId pl price reason side stopLossPrice time tradeId tradeOpened type units
0 99987.8214 7173488 NaN 10618882724 USD_JPY 0.0000 NaN -0.1736 115.19000 NaN sell NaN 2017-01-27T13:55:07.000000Z 1.061888e+10 NaN TRADE_CLOSE 1000.0
1 99987.9950 7173488 NaN 10618882484 USD_JPY 0.0000 NaN 0.0000 115.20400 NaN buy NaN 2017-01-27T13:55:06.000000Z NaN {'units': 1000, 'id': 10618882484} MARKET_ORDER_CREATE 1000.0
2 99987.9950 7173488 NaN 10618882479 NZD_USD 0.0000 NaN 0.0000 0.72637 NaN buy NaN 2017-01-27T13:55:06.000000Z NaN {'units': 1000, 'id': 10618882479} MARKET_ORDER_CREATE 1000.0
3 99987.9950 7173488 NaN 10618882472 AUD_USD 0.0000 NaN 0.0000 0.75516 NaN buy NaN 2017-01-27T13:55:06.000000Z NaN {'units': 1000, 'id': 10618882472} MARKET_ORDER_CREATE 1000.0
4 99987.9950 7173488 NaN 10618881962 GBP_USD 0.0000 NaN -0.2572 1.25420 NaN sell NaN 2017-01-27T13:54:40.000000Z 1.061888e+10 NaN TRADE_CLOSE 1000.0
5 NaN 7173488 NaN 10618881951 GBP_USD NaN NaN NaN NaN NaN NaN 1.15 2017-01-27T13:54:40.000000Z 1.061888e+10 NaN TRADE_UPDATE 1000.0
6 99988.2522 7173488 NaN 10618881939 GBP_USD 0.0000 NaN 0.0000 1.25438 NaN buy NaN 2017-01-27T13:54:39.000000Z NaN {'units': 1000, 'id': 10618881939} MARKET_ORDER_CREATE 1000.0
7 99988.2522 7173488 NaN 10618881930 USD_CHF 0.0000 NaN 0.0000 0.99977 NaN buy NaN 2017-01-27T13:54:39.000000Z NaN {'units': 1000, 'id': 10618881930} MARKET_ORDER_CREATE 1000.0
8 99988.2522 7173488 NaN 10618881925 EUR_USD 0.0000 NaN 0.0000 1.06951 NaN buy NaN 2017-01-27T13:54:38.000000Z NaN {'units': 1000, 'id': 10618881925} MARKET_ORDER_CREATE 1000.0
9 NaN 7173488 NaN 10618881452 NaN NaN 1.061888e+10 NaN NaN CLIENT_REQUEST NaN NaN 2017-01-27T13:54:20.000000Z NaN NaN ORDER_CANCEL NaN
10 NaN 7173488 2017-01-28T21:54:17.000000Z 10618881427 AUD_USD NaN 1.061888e+10 NaN 0.70400 REPLACES_ORDER NaN NaN 2017-01-27T13:54:20.000000Z NaN NaN ORDER_UPDATE 1000.0
11 NaN 7173488 2017-01-28T21:54:17.000000Z 10618881403 AUD_USD NaN NaN NaN 0.74200 CLIENT_REQUEST buy NaN 2017-01-27T13:54:18.000000Z NaN NaN LIMIT_ORDER_CREATE 1000.0
12 99988.2522 7173488 NaN 10618045173 USD_CHF 0.0588 NaN NaN NaN NaN NaN NaN 2017-01-26T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
13 99988.1934 7173488 NaN 10618045172 NZD_USD 0.0610 NaN NaN NaN NaN NaN NaN 2017-01-26T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
14 99988.1324 7173488 NaN 10618045171 GBP_USD -0.0281 NaN NaN NaN NaN NaN NaN 2017-01-26T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
15 99988.1605 7173488 NaN 10618045170 EUR_USD -0.1619 NaN NaN NaN NaN NaN NaN 2017-01-26T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
16 99988.3224 7173488 NaN 10618045169 AUD_USD 0.0724 NaN NaN NaN NaN NaN NaN 2017-01-26T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
17 99988.2500 7173488 NaN 10616745950 USD_CHF 0.0582 NaN NaN NaN NaN NaN NaN 2017-01-25T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
18 99988.1918 7173488 NaN 10616745949 NZD_USD 0.0611 NaN NaN NaN NaN NaN NaN 2017-01-25T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
19 99988.1307 7173488 NaN 10616745948 GBP_USD -0.0278 NaN NaN NaN NaN NaN NaN 2017-01-25T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
20 99988.1585 7173488 NaN 10616745947 EUR_USD -0.1606 NaN NaN NaN NaN NaN NaN 2017-01-25T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
21 99988.3191 7173488 NaN 10616745946 AUD_USD 0.0730 NaN NaN NaN NaN NaN NaN 2017-01-25T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
22 99988.2461 7173488 NaN 10615478582 USD_CHF 0.0582 NaN NaN NaN NaN NaN NaN 2017-01-24T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
23 99988.1879 7173488 NaN 10615478581 NZD_USD 0.0609 NaN NaN NaN NaN NaN NaN 2017-01-24T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
24 99988.1270 7173488 NaN 10615478580 GBP_USD -0.0280 NaN NaN NaN NaN NaN NaN 2017-01-24T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
25 99988.1550 7173488 NaN 10615478579 EUR_USD -0.1616 NaN NaN NaN NaN NaN NaN 2017-01-24T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
26 99988.3166 7173488 NaN 10615478578 AUD_USD 0.0738 NaN NaN NaN NaN NaN NaN 2017-01-24T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
27 99988.2428 7173488 NaN 10614205734 USD_CHF 0.0582 NaN NaN NaN NaN NaN NaN 2017-01-23T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
28 99988.1846 7173488 NaN 10614205733 NZD_USD 0.0603 NaN NaN NaN NaN NaN NaN 2017-01-23T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
29 99988.1243 7173488 NaN 10614205732 GBP_USD -0.0280 NaN NaN NaN NaN NaN NaN 2017-01-23T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
30 99988.1523 7173488 NaN 10614205731 EUR_USD -0.1612 NaN NaN NaN NaN NaN NaN 2017-01-23T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
31 99988.3135 7173488 NaN 10614205730 AUD_USD 0.0731 NaN NaN NaN NaN NaN NaN 2017-01-23T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
32 99988.2404 7173488 NaN 10612893759 USD_CHF 0.0588 NaN NaN NaN NaN NaN NaN 2017-01-22T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
33 99988.1816 7173488 NaN 10612893758 NZD_USD 0.0592 NaN NaN NaN NaN NaN NaN 2017-01-22T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
34 99988.1224 7173488 NaN 10612893757 GBP_USD -0.0282 NaN NaN NaN NaN NaN NaN 2017-01-22T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
35 99988.1506 7173488 NaN 10612893756 EUR_USD -0.1622 NaN NaN NaN NaN NaN NaN 2017-01-22T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
36 99988.3128 7173488 NaN 10612893755 AUD_USD 0.0730 NaN NaN NaN NaN NaN NaN 2017-01-22T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
37 99988.2398 7173488 NaN 10612516793 USD_CHF 0.0588 NaN NaN NaN NaN NaN NaN 2017-01-21T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
38 99988.1810 7173488 NaN 10612516792 NZD_USD 0.0592 NaN NaN NaN NaN NaN NaN 2017-01-21T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
39 99988.1218 7173488 NaN 10612516791 GBP_USD -0.0282 NaN NaN NaN NaN NaN NaN 2017-01-21T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
40 99988.1500 7173488 NaN 10612516790 EUR_USD -0.1622 NaN NaN NaN NaN NaN NaN 2017-01-21T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
41 99988.3122 7173488 NaN 10612516789 AUD_USD 0.0730 NaN NaN NaN NaN NaN NaN 2017-01-21T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
42 99988.2392 7173488 NaN 10612124336 USD_CHF 0.0565 NaN NaN NaN NaN NaN NaN 2017-01-20T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
43 99988.1827 7173488 NaN 10612124335 NZD_USD 0.0567 NaN NaN NaN NaN NaN NaN 2017-01-20T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
44 99988.1260 7173488 NaN 10612124334 GBP_USD -0.0281 NaN NaN NaN NaN NaN NaN 2017-01-20T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
45 99988.1541 7173488 NaN 10612124333 EUR_USD -0.1556 NaN NaN NaN NaN NaN NaN 2017-01-20T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
46 99988.3097 7173488 NaN 10612124332 AUD_USD 0.0707 NaN NaN NaN NaN NaN NaN 2017-01-20T21:00:00.000000Z NaN NaN DAILY_INTEREST NaN
47 99988.2390 7173488 NaN 10611191636 USD_JPY 0.0000 NaN -0.1739 114.73900 NaN sell NaN 2017-01-20T02:34:19.000000Z 1.061119e+10 NaN TRADE_CLOSE 1000.0
48 99988.4129 7173488 NaN 10611191619 USD_JPY 0.0000 NaN 0.0000 114.75300 NaN buy NaN 2017-01-20T02:34:17.000000Z NaN {'units': 1000, 'id': 10611191619} MARKET_ORDER_CREATE 1000.0
49 99988.4129 7173488 NaN 10611191617 NZD_USD 0.0000 NaN 0.0000 0.72067 NaN buy NaN 2017-01-20T02:34:16.000000Z NaN {'units': 1000, 'id': 10611191617} MARKET_ORDER_CREATE 1000.0

Get Specific Transaction Information

get_transaction(self, account_id, transaction_id)


In [4]:
response = oanda.get_transaction(account_id, 
                                 transaction_id=10605643945)

In [5]:
print(response)


{'instrument': 'AUD_USD', 'interest': 0, 'time': '2017-01-16T03:35:00.000000Z', 'tradeOpened': {'units': 1000, 'id': 10605643945}, 'side': 'buy', 'price': 0.7478, 'accountId': 7173488, 'accountBalance': 99991.7798, 'type': 'MARKET_ORDER_CREATE', 'id': 10605643945, 'units': 1000, 'pl': 0}